import { FC } from 'react'
import { Card, Col, Row } from 'antd'
import { useYesterday } from '@/hooks/dashboard'

const OrderOverview: FC = () => {
  const { loading, count } = useYesterday()
  const { forwardingOrderNum, rightsOrderProtectionNum, yesterdayOrderNum, yesterdayTransactionAmount, withdrawalBalance } = count

  return (
    <Card loading={loading} hoverable className="app-dashboard-overview">
      <Row gutter={20}>
        <Col span={5}>
          <h4 className="flag">{forwardingOrderNum}</h4>
          <p>待发货订单</p>
        </Col>
        <Col span={5}>
          <h4 className="flag">{rightsOrderProtectionNum}</h4>
          <p>维权订单</p>
        </Col>
        <Col span={5}>
          <h4 className="flag">{yesterdayOrderNum}</h4>
          <p>昨日订单</p>
        </Col>
        <Col span={5}>
          <h4 className="flag">¥{yesterdayTransactionAmount}</h4>
          <p>昨日交易额</p>
        </Col>
        <Col span={5}>
          <h4 className="flag">¥{withdrawalBalance}</h4>
          <p>可提现余额</p>
        </Col>
      </Row>
    </Card>
  )
}

export default OrderOverview
